<!DOCTYPE html>


<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Phaser CE Class: P2</title>
	<link rel="stylesheet" href="styles/site.phaser.css?2024100511">
</head>

<body>


<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
  <div class="container-fluid">
  	<div class="navbar-header">
  		<a class="navbar-brand" href="index.html">Phaser CE</a>
  		<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
  			<span class="icon-bar"></span>
  			<span class="icon-bar"></span>
  			<span class="icon-bar"></span>
      </button>
  	</div>
  	<div class="navbar-collapse collapse" id="topNavigation">
  		<ul class="nav navbar-nav">
  			
  			<li class="dropdown">
  				<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
  				<ul class="dropdown-menu ">
  					<li><a href="Phaser.html">Phaser</a></li><li><a href="PhaserGlobal.html">PhaserGlobal</a></li><li><a href="PIXI.html">PIXI</a></li>
  				</ul>
  			</li>
  			
  			<li class="dropdown">
  				<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
  				<ul class="dropdown-menu ">
  					<li><a href="CreatureShader.html">CreatureShader</a></li><li><a href="EarCut.html">EarCut</a></li><li><a href="Event.html">Event</a></li><li><a href="EventTarget.html">EventTarget</a></li><li><a href="Phaser.Animation.html">Phaser.Animation</a></li><li><a href="Phaser.AnimationManager.html">Phaser.AnimationManager</a></li><li><a href="Phaser.AnimationParser.html">Phaser.AnimationParser</a></li><li><a href="Phaser.ArraySet.html">Phaser.ArraySet</a></li><li><a href="Phaser.ArrayUtils.html">Phaser.ArrayUtils</a></li><li><a href="Phaser.AudioSprite.html">Phaser.AudioSprite</a></li><li><a href="Phaser.BitmapData.html">Phaser.BitmapData</a></li><li><a href="Phaser.BitmapText.html">Phaser.BitmapText</a></li><li><a href="Phaser.Bullet.html">Phaser.Bullet</a></li><li><a href="Phaser.Button.html">Phaser.Button</a></li><li><a href="Phaser.Cache.html">Phaser.Cache</a></li><li><a href="Phaser.Camera.html">Phaser.Camera</a></li><li><a href="Phaser.Canvas.html">Phaser.Canvas</a></li><li><a href="Phaser.CanvasPool.html">Phaser.CanvasPool</a></li><li><a href="Phaser.Circle.html">Phaser.Circle</a></li><li><a href="Phaser.Color.html">Phaser.Color</a></li><li><a href="Phaser.Component.Angle.html">Phaser.Component.Angle</a></li><li><a href="Phaser.Component.Animation.html">Phaser.Component.Animation</a></li><li><a href="Phaser.Component.AutoCull.html">Phaser.Component.AutoCull</a></li><li><a href="Phaser.Component.Bounds.html">Phaser.Component.Bounds</a></li><li><a href="Phaser.Component.BringToTop.html">Phaser.Component.BringToTop</a></li><li><a href="Phaser.Component.Core.html">Phaser.Component.Core</a></li><li><a href="Phaser.Component.Crop.html">Phaser.Component.Crop</a></li><li><a href="Phaser.Component.Delta.html">Phaser.Component.Delta</a></li><li><a href="Phaser.Component.Destroy.html">Phaser.Component.Destroy</a></li><li><a href="Phaser.Component.FixedToCamera.html">Phaser.Component.FixedToCamera</a></li><li><a href="Phaser.Component.Health.html">Phaser.Component.Health</a></li><li><a href="Phaser.Component.InCamera.html">Phaser.Component.InCamera</a></li><li><a href="Phaser.Component.InputEnabled.html">Phaser.Component.InputEnabled</a></li><li><a href="Phaser.Component.InWorld.html">Phaser.Component.InWorld</a></li><li><a href="Phaser.Component.LifeSpan.html">Phaser.Component.LifeSpan</a></li><li><a href="Phaser.Component.LoadTexture.html">Phaser.Component.LoadTexture</a></li><li><a href="Phaser.Component.Overlap.html">Phaser.Component.Overlap</a></li><li><a href="Phaser.Component.PhysicsBody.html">Phaser.Component.PhysicsBody</a></li><li><a href="Phaser.Component.Reset.html">Phaser.Component.Reset</a></li><li><a href="Phaser.Component.ScaleMinMax.html">Phaser.Component.ScaleMinMax</a></li><li><a href="Phaser.Component.Smoothed.html">Phaser.Component.Smoothed</a></li><li><a href="Phaser.Create.html">Phaser.Create</a></li><li><a href="Phaser.Creature.html">Phaser.Creature</a></li><li><a href="Phaser.Device.html">Phaser.Device</a></li><li><a href="Phaser.DeviceButton.html">Phaser.DeviceButton</a></li><li><a href="Phaser.DOM.html">Phaser.DOM</a></li><li><a href="Phaser.Easing.html">Phaser.Easing</a></li><li><a href="Phaser.Easing.Back.html">Phaser.Easing.Back</a></li><li><a href="Phaser.Easing.Bounce.html">Phaser.Easing.Bounce</a></li><li><a href="Phaser.Easing.Circular.html">Phaser.Easing.Circular</a></li><li><a href="Phaser.Easing.Cubic.html">Phaser.Easing.Cubic</a></li><li><a href="Phaser.Easing.Elastic.html">Phaser.Easing.Elastic</a></li><li><a href="Phaser.Easing.Exponential.html">Phaser.Easing.Exponential</a></li><li><a href="Phaser.Easing.Linear.html">Phaser.Easing.Linear</a></li><li><a href="Phaser.Easing.Quadratic.html">Phaser.Easing.Quadratic</a></li><li><a href="Phaser.Easing.Quartic.html">Phaser.Easing.Quartic</a></li><li><a href="Phaser.Easing.Quintic.html">Phaser.Easing.Quintic</a></li><li><a href="Phaser.Easing.Sinusoidal.html">Phaser.Easing.Sinusoidal</a></li><li><a href="Phaser.Ellipse.html">Phaser.Ellipse</a></li><li><a href="Phaser.Events.html">Phaser.Events</a></li><li><a href="Phaser.Filter.html">Phaser.Filter</a></li><li><a href="Phaser.FlexGrid.html">Phaser.FlexGrid</a></li><li><a href="Phaser.FlexLayer.html">Phaser.FlexLayer</a></li><li><a href="Phaser.Frame.html">Phaser.Frame</a></li><li><a href="Phaser.FrameData.html">Phaser.FrameData</a></li><li><a href="Phaser.Game.html">Phaser.Game</a></li><li><a href="Phaser.GameObjectCreator.html">Phaser.GameObjectCreator</a></li><li><a href="Phaser.GameObjectFactory.html">Phaser.GameObjectFactory</a></li><li><a href="Phaser.Gamepad.html">Phaser.Gamepad</a></li><li><a href="Phaser.Graphics.html">Phaser.Graphics</a></li><li><a href="Phaser.GraphicsData.html">Phaser.GraphicsData</a></li><li><a href="Phaser.Group.html">Phaser.Group</a></li><li><a href="Phaser.Hermite.html">Phaser.Hermite</a></li><li><a href="Phaser.Image.html">Phaser.Image</a></li><li><a href="Phaser.ImageCollection.html">Phaser.ImageCollection</a></li><li><a href="Phaser.Input.html">Phaser.Input</a></li><li><a href="Phaser.InputHandler.html">Phaser.InputHandler</a></li><li><a href="Phaser.Key.html">Phaser.Key</a></li><li><a href="Phaser.Keyboard.html">Phaser.Keyboard</a></li><li><a href="Phaser.KeyCode.html">Phaser.KeyCode</a></li><li><a href="Phaser.Line.html">Phaser.Line</a></li><li><a href="Phaser.LinkedList.html">Phaser.LinkedList</a></li><li><a href="Phaser.Loader.html">Phaser.Loader</a></li><li><a href="Phaser.LoaderParser.html">Phaser.LoaderParser</a></li><li><a href="Phaser.Math.html">Phaser.Math</a></li><li><a href="Phaser.Matrix.html">Phaser.Matrix</a></li><li><a href="Phaser.Mouse.html">Phaser.Mouse</a></li><li><a href="Phaser.MouseWheel.html">Phaser.MouseWheel</a></li><li><a href="Phaser.MSPointer.html">Phaser.MSPointer</a></li><li><a href="Phaser.Particle.html">Phaser.Particle</a></li><li><a href="Phaser.Particles.html">Phaser.Particles</a></li><li><a href="Phaser.Particles.Arcade.html">Phaser.Particles.Arcade</a></li><li><a href="Phaser.Particles.Arcade.Emitter.html">Phaser.Particles.Arcade.Emitter</a></li><li><a href="Phaser.Path.html">Phaser.Path</a></li><li><a href="Phaser.PathFollower.html">Phaser.PathFollower</a></li><li><a href="Phaser.PathPoint.html">Phaser.PathPoint</a></li><li><a href="Phaser.Physics.html">Phaser.Physics</a></li><li><a href="Phaser.Physics.Arcade.html">Phaser.Physics.Arcade</a></li><li><a href="Phaser.Physics.Arcade.Body.html">Phaser.Physics.Arcade.Body</a></li><li><a href="Phaser.Physics.Arcade.TilemapCollision.html">Phaser.Physics.Arcade.TilemapCollision</a></li><li><a href="Phaser.Physics.Ninja.html">Phaser.Physics.Ninja</a></li><li><a href="Phaser.Physics.Ninja.AABB.html">Phaser.Physics.Ninja.AABB</a></li><li><a href="Phaser.Physics.Ninja.Body.html">Phaser.Physics.Ninja.Body</a></li><li><a href="Phaser.Physics.Ninja.Circle.html">Phaser.Physics.Ninja.Circle</a></li><li><a href="Phaser.Physics.Ninja.Tile.html">Phaser.Physics.Ninja.Tile</a></li><li><a href="Phaser.Physics.P2.html">Phaser.Physics.P2</a></li><li><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></li><li><a href="Phaser.Physics.P2.BodyDebug.html">Phaser.Physics.P2.BodyDebug</a></li><li><a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></li><li><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></li><li><a href="Phaser.Physics.P2.DistanceConstraint.html">Phaser.Physics.P2.DistanceConstraint</a></li><li><a href="Phaser.Physics.P2.FixtureList.html">Phaser.Physics.P2.FixtureList</a></li><li><a href="Phaser.Physics.P2.GearConstraint.html">Phaser.Physics.P2.GearConstraint</a></li><li><a href="Phaser.Physics.P2.InversePointProxy.html">Phaser.Physics.P2.InversePointProxy</a></li><li><a href="Phaser.Physics.P2.LockConstraint.html">Phaser.Physics.P2.LockConstraint</a></li><li><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></li><li><a href="Phaser.Physics.P2.PointProxy.html">Phaser.Physics.P2.PointProxy</a></li><li><a href="Phaser.Physics.P2.PrismaticConstraint.html">Phaser.Physics.P2.PrismaticConstraint</a></li><li><a href="Phaser.Physics.P2.RevoluteConstraint.html">Phaser.Physics.P2.RevoluteConstraint</a></li><li><a href="Phaser.Physics.P2.RotationalSpring.html">Phaser.Physics.P2.RotationalSpring</a></li><li><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></li><li><a href="Phaser.Plugin.html">Phaser.Plugin</a></li><li><a href="Phaser.Plugin.PathManager.html">Phaser.Plugin.PathManager</a></li><li><a href="Phaser.PluginManager.html">Phaser.PluginManager</a></li><li><a href="Phaser.Point.html">Phaser.Point</a></li><li><a href="Phaser.Pointer.html">Phaser.Pointer</a></li><li><a href="Phaser.PointerLock.html">Phaser.PointerLock</a></li><li><a href="Phaser.PointerMode.html">Phaser.PointerMode</a></li><li><a href="Phaser.Polygon.html">Phaser.Polygon</a></li><li><a href="Phaser.QuadTree.html">Phaser.QuadTree</a></li><li><a href="Phaser.RandomDataGenerator.html">Phaser.RandomDataGenerator</a></li><li><a href="Phaser.Rectangle.html">Phaser.Rectangle</a></li><li><a href="Phaser.RenderTexture.html">Phaser.RenderTexture</a></li><li><a href="Phaser.RequestAnimationFrame.html">Phaser.RequestAnimationFrame</a></li><li><a href="Phaser.RetroFont.html">Phaser.RetroFont</a></li><li><a href="Phaser.Rope.html">Phaser.Rope</a></li><li><a href="Phaser.RoundedRectangle.html">Phaser.RoundedRectangle</a></li><li><a href="Phaser.ScaleManager.html">Phaser.ScaleManager</a></li><li><a href="Phaser.Signal.html">Phaser.Signal</a></li><li><a href="Phaser.SignalBinding.html">Phaser.SignalBinding</a></li><li><a href="Phaser.SinglePad.html">Phaser.SinglePad</a></li><li><a href="Phaser.Sound.html">Phaser.Sound</a></li><li><a href="Phaser.SoundManager.html">Phaser.SoundManager</a></li><li><a href="Phaser.Sprite.html">Phaser.Sprite</a></li><li><a href="Phaser.SpriteBatch.html">Phaser.SpriteBatch</a></li><li><a href="Phaser.Stage.html">Phaser.Stage</a></li><li><a href="Phaser.State.html">Phaser.State</a></li><li><a href="Phaser.StateManager.html">Phaser.StateManager</a></li><li><a href="Phaser.Text.html">Phaser.Text</a></li><li><a href="Phaser.Tile.html">Phaser.Tile</a></li><li><a href="Phaser.Tilemap.html">Phaser.Tilemap</a></li><li><a href="Phaser.TilemapLayer.html">Phaser.TilemapLayer</a></li><li><a href="Phaser.TilemapParser.html">Phaser.TilemapParser</a></li><li><a href="Phaser.Tileset.html">Phaser.Tileset</a></li><li><a href="Phaser.TileSprite.html">Phaser.TileSprite</a></li><li><a href="Phaser.Time.html">Phaser.Time</a></li><li><a href="Phaser.Timer.html">Phaser.Timer</a></li><li><a href="Phaser.TimerEvent.html">Phaser.TimerEvent</a></li><li><a href="Phaser.Touch.html">Phaser.Touch</a></li><li><a href="Phaser.Tween.html">Phaser.Tween</a></li><li><a href="Phaser.TweenData.html">Phaser.TweenData</a></li><li><a href="Phaser.TweenManager.html">Phaser.TweenManager</a></li><li><a href="Phaser.Utils.html">Phaser.Utils</a></li><li><a href="Phaser.Utils.Debug.html">Phaser.Utils.Debug</a></li><li><a href="Phaser.Video.html">Phaser.Video</a></li><li><a href="Phaser.Weapon.html">Phaser.Weapon</a></li><li><a href="Phaser.World.html">Phaser.World</a></li><li><a href="PIXI.BaseTexture.html">PIXI.BaseTexture</a></li><li><a href="PIXI.CanvasBuffer.html">PIXI.CanvasBuffer</a></li><li><a href="PIXI.CanvasGraphics.html">PIXI.CanvasGraphics</a></li><li><a href="PIXI.CanvasMaskManager.html">PIXI.CanvasMaskManager</a></li><li><a href="PIXI.CanvasRenderer.html">PIXI.CanvasRenderer</a></li><li><a href="PIXI.CanvasTinter.html">PIXI.CanvasTinter</a></li><li><a href="PIXI.ComplexPrimitiveShader.html">PIXI.ComplexPrimitiveShader</a></li><li><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></li><li><a href="PIXI.DisplayObjectContainer.html">PIXI.DisplayObjectContainer</a></li><li><a href="PIXI.FilterTexture.html">PIXI.FilterTexture</a></li><li><a href="PIXI.PixiFastShader.html">PIXI.PixiFastShader</a></li><li><a href="PIXI.PixiShader.html">PIXI.PixiShader</a></li><li><a href="PIXI.PrimitiveShader.html">PIXI.PrimitiveShader</a></li><li><a href="PIXI.Sprite.html">PIXI.Sprite</a></li><li><a href="PIXI.StripShader.html">PIXI.StripShader</a></li><li><a href="PIXI.Texture.html">PIXI.Texture</a></li><li><a href="PIXI.WebGLBlendModeManager.html">PIXI.WebGLBlendModeManager</a></li><li><a href="PIXI.WebGLFastSpriteBatch.html">PIXI.WebGLFastSpriteBatch</a></li><li><a href="PIXI.WebGLFilterManager.html">PIXI.WebGLFilterManager</a></li><li><a href="PIXI.WebGLRenderer.html">PIXI.WebGLRenderer</a></li>
  				</ul>
  			</li>
  			
  			<li class="dropdown">
  				<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
  				<ul class="dropdown-menu ">
  					<li><a href="global.html">Global</a></li>
  				</ul>
  			</li>
  			
        <li>
  <a href="https://github.com/photonstorm/phaser-ce/blob/master/README.md">
    <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
    README
  </a>
</li>

<li>
  <a href="https://github.com/photonstorm/phaser-ce/blob/master/CHANGELOG.md">
    <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
    CHANGELOG
  </a>
</li>

<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
    <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
    Community
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
    <li>
      <a href="http://phaser.io">Phaser</a>
    </li>
    <li>
      <a href="https://github.com/photonstorm/phaser-ce">Phaser CE on GitHub</a>
    </li>
    <li>
      <a href="https://codepen.io/collection/AMbZgY/">Phaser CE Examples</a>
    </li>
    <li>
      <a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a>
    </li>
    <li>
      <a href="https://twitter.com/photonstorm">Twitter</a>
    </li>
    <li>
      <a href="http://phaser.io/community/slack">Slack</a>
    </li>
    <li>
      <a href="http://phaser.io/community/donate">Donate</a>
    </li>
  </ul>
</li>

  		</ul>
          
  	</div>
  </div>
</div>


<div class="container-fluid" id="toc-content">
	<div class="row">
		
	  <div class="col-md-9 col-md-offset-3">
		
			<div id="main">

	<h1 class="page-title">Class: P2</h1>
<section>

<header>
    
        <h2>
            <span class="ancestors"><a href="Phaser.html">Phaser</a><a href="Phaser.Physics.html">.Physics</a>.</span>
        
        P2
        </h2>
        
    
</header>


<article>
    <div class="container-overview">
    
        
<dt>
    <h4 class="name" id="P2" data-name="P2">
      <span class="type-signature"></span>new P2(game [, config])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>This is your main access to the P2 Physics World.
From here you can create materials, listen for events and add bodies into the physics simulation.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>game</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Reference to the current game instance.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Physics configuration object passed in from the game constructor.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L20" title="P2 on line 20 of src/physics/p2/World.js">src/physics/p2/World.js line 20</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

    
    </div>

    

    

    
        <h3 class="subsection-title">Classes</h3>

        <dl>
            <dt><a href="Phaser.Physics.P2.Body.html">Body</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.Material.html">Material</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a></dt>
            <dd></dd>
        
            <dt><a href="Phaser.Physics.P2.Spring.html">Spring</a></dt>
            <dd></dd>
        </dl>
    

    

    

    
        <h3 class="subsection-title">Members</h3>

        <dl>
            
<dt>
    <h4 id="applyDamping" data-name="applyDamping">
      <span class="type-signature"></span>applyDamping<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Enable to automatically apply body damping each step.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1997" title="applyDamping on line 1997 of src/physics/p2/World.js">src/physics/p2/World.js line 1997</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="applyGravity" data-name="applyGravity">
      <span class="type-signature"></span>applyGravity<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Enable to automatically apply gravity each step.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L2019" title="applyGravity on line 2019 of src/physics/p2/World.js">src/physics/p2/World.js line 2019</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="applySpringForces" data-name="applySpringForces">
      <span class="type-signature"></span>applySpringForces<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Enable to automatically apply spring forces each step.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1975" title="applySpringForces on line 1975 of src/physics/p2/World.js">src/physics/p2/World.js line 1975</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="boundsCollidesWith" data-name="boundsCollidesWith">
      <span class="type-signature"></span>boundsCollidesWith<span class="type-signature"> : array</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>An array of the bodies the world bounds collides with.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">array</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L233" title="boundsCollidesWith on line 233 of src/physics/p2/World.js">src/physics/p2/World.js line 233</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="boundsCollisionGroup" data-name="boundsCollisionGroup">
      <span class="type-signature"></span>boundsCollisionGroup<span class="type-signature"> : <a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A default collision group.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L223" title="boundsCollisionGroup on line 223 of src/physics/p2/World.js">src/physics/p2/World.js line 223</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="callbackContext" data-name="callbackContext">
      <span class="type-signature"></span>callbackContext<span class="type-signature"> : object</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The context under which the callbacks are fired.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">object</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L171" title="callbackContext on line 171 of src/physics/p2/World.js">src/physics/p2/World.js line 171</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="collisionGroups" data-name="collisionGroups">
      <span class="type-signature"></span>collisionGroups<span class="type-signature"> : array</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>An array containing the collision groups that have been defined in the World.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">array</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L213" title="collisionGroups on line 213 of src/physics/p2/World.js">src/physics/p2/World.js line 213</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="config" data-name="config">
      <span class="type-signature">&lt;protected> </span>config<span class="type-signature"> : object</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The p2 World configuration object.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">object</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L49" title="config on line 49 of src/physics/p2/World.js">src/physics/p2/World.js line 49</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="contactMaterial" data-name="contactMaterial">
      <span class="type-signature"></span>contactMaterial<span class="type-signature"> : p2.ContactMaterial</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The default Contact Material being used by the World.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">p2.ContactMaterial</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1953" title="contactMaterial on line 1953 of src/physics/p2/World.js">src/physics/p2/World.js line 1953</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="emitImpactEvent" data-name="emitImpactEvent">
      <span class="type-signature"></span>emitImpactEvent<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Set to true if you want to the world to emit the &quot;impact&quot; event. Turning this off could improve performance.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L2079" title="emitImpactEvent on line 2079 of src/physics/p2/World.js">src/physics/p2/World.js line 2079</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="everythingCollisionGroup" data-name="everythingCollisionGroup">
      <span class="type-signature"></span>everythingCollisionGroup<span class="type-signature"> : <a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A default collision group.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L228" title="everythingCollisionGroup on line 228 of src/physics/p2/World.js">src/physics/p2/World.js line 228</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="frameRate" data-name="frameRate">
      <span class="type-signature"></span>frameRate<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L61" title="frameRate on line 61 of src/physics/p2/World.js">src/physics/p2/World.js line 61</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="friction" data-name="friction">
      <span class="type-signature"></span>friction<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1909" title="friction on line 1909 of src/physics/p2/World.js">src/physics/p2/World.js line 1909</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="game" data-name="game">
      <span class="type-signature"></span>game<span class="type-signature"> : <a href="Phaser.Game.html">Phaser.Game</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Local reference to game.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L26" title="game on line 26 of src/physics/p2/World.js">src/physics/p2/World.js line 26</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="gravity" data-name="gravity">
      <span class="type-signature"></span>gravity<span class="type-signature"> : <a href="Phaser.Physics.P2.InversePointProxy.html">Phaser.Physics.P2.InversePointProxy</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The gravity applied to all bodies each step.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Physics.P2.InversePointProxy.html">Phaser.Physics.P2.InversePointProxy</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L84" title="gravity on line 84 of src/physics/p2/World.js">src/physics/p2/World.js line 84</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="materials" data-name="materials">
      <span class="type-signature">&lt;protected> </span>materials<span class="type-signature"> : array.&lt;<a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a>></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A local array of all created Materials.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">array.&lt;<a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a>></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L79" title="materials on line 79 of src/physics/p2/World.js">src/physics/p2/World.js line 79</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="nothingCollisionGroup" data-name="nothingCollisionGroup">
      <span class="type-signature"></span>nothingCollisionGroup<span class="type-signature"> : <a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A default collision group.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L218" title="nothingCollisionGroup on line 218 of src/physics/p2/World.js">src/physics/p2/World.js line 218</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onBeginContact" data-name="onBeginContact">
      <span class="type-signature"></span>onBeginContact<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This Signal is dispatched when a first contact is created between two bodies. This happens <em>before</em> the step has been done.</p>
<p>It sends 5 arguments: <code>bodyA</code>, <code>bodyB</code>, <code>shapeA</code>, <code>shapeB</code> and <code>contactEquations</code>.</p>
<p>It is possible that in certain situations the <code>bodyA</code> or <code>bodyB</code> values are <code>null</code>. You should check for this
in your own code to avoid processing potentially null physics bodies.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L183" title="onBeginContact on line 183 of src/physics/p2/World.js">src/physics/p2/World.js line 183</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onBodyAdded" data-name="onBodyAdded">
      <span class="type-signature"></span>onBodyAdded<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a new Body is added to the World.</p>
<p>It sends 1 argument: <code>body</code> which is the <code>Phaser.Physics.P2.Body</code> that was added to the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L98" title="onBodyAdded on line 98 of src/physics/p2/World.js">src/physics/p2/World.js line 98</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onBodyRemoved" data-name="onBodyRemoved">
      <span class="type-signature"></span>onBodyRemoved<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Body is removed to the World.</p>
<p>It sends 1 argument: <code>body</code> which is the <code>Phaser.Physics.P2.Body</code> that was removed from the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L107" title="onBodyRemoved on line 107 of src/physics/p2/World.js">src/physics/p2/World.js line 107</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onConstraintAdded" data-name="onConstraintAdded">
      <span class="type-signature"></span>onConstraintAdded<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Constraint is added to the World.</p>
<p>It sends 1 argument: <code>constraint</code> which is the <code>Phaser.Physics.P2.Constraint</code> that was added to the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L134" title="onConstraintAdded on line 134 of src/physics/p2/World.js">src/physics/p2/World.js line 134</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onConstraintRemoved" data-name="onConstraintRemoved">
      <span class="type-signature"></span>onConstraintRemoved<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Constraint is removed from the World.</p>
<p>It sends 1 argument: <code>constraint</code> which is the <code>Phaser.Physics.P2.Constraint</code> that was removed from the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L143" title="onConstraintRemoved on line 143 of src/physics/p2/World.js">src/physics/p2/World.js line 143</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onContactMaterialAdded" data-name="onContactMaterialAdded">
      <span class="type-signature"></span>onContactMaterialAdded<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Contact Material is added to the World.</p>
<p>It sends 1 argument: <code>material</code> which is the <code>Phaser.Physics.P2.ContactMaterial</code> that was added to the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L152" title="onContactMaterialAdded on line 152 of src/physics/p2/World.js">src/physics/p2/World.js line 152</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onContactMaterialRemoved" data-name="onContactMaterialRemoved">
      <span class="type-signature"></span>onContactMaterialRemoved<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Contact Material is removed from the World.</p>
<p>It sends 1 argument: <code>material</code> which is the <code>Phaser.Physics.P2.ContactMaterial</code> that was removed from the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L161" title="onContactMaterialRemoved on line 161 of src/physics/p2/World.js">src/physics/p2/World.js line 161</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onEndContact" data-name="onEndContact">
      <span class="type-signature"></span>onEndContact<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This Signal is dispatched when final contact occurs between two bodies. This happens <em>before</em> the step has been done.</p>
<p>It sends 4 arguments: <code>bodyA</code>, <code>bodyB</code>, <code>shapeA</code> and <code>shapeB</code>.</p>
<p>It is possible that in certain situations the <code>bodyA</code> or <code>bodyB</code> values are <code>null</code>. You should check for this
in your own code to avoid processing potentially null physics bodies.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L195" title="onEndContact on line 195 of src/physics/p2/World.js">src/physics/p2/World.js line 195</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onSpringAdded" data-name="onSpringAdded">
      <span class="type-signature"></span>onSpringAdded<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Spring is added to the World.</p>
<p>It sends 1 argument: <code>spring</code> which is either a <code>Phaser.Physics.P2.Spring</code>, <code>p2.LinearSpring</code> or <code>p2.RotationalSpring</code> that was added to the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L116" title="onSpringAdded on line 116 of src/physics/p2/World.js">src/physics/p2/World.js line 116</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onSpringRemoved" data-name="onSpringRemoved">
      <span class="type-signature"></span>onSpringRemoved<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This signal is dispatched when a Spring is removed from the World.</p>
<p>It sends 1 argument: <code>spring</code> which is either a <code>Phaser.Physics.P2.Spring</code>, <code>p2.LinearSpring</code> or <code>p2.RotationalSpring</code> that was removed from the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L125" title="onSpringRemoved on line 125 of src/physics/p2/World.js">src/physics/p2/World.js line 125</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="paused" data-name="paused">
      <span class="type-signature"></span>paused<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The paused state of the P2 World.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L73" title="paused on line 73 of src/physics/p2/World.js">src/physics/p2/World.js line 73</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="postBroadphaseCallback" data-name="postBroadphaseCallback">
      <span class="type-signature"></span>postBroadphaseCallback<span class="type-signature"> : function</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A postBroadphase callback.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">function</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L166" title="postBroadphaseCallback on line 166 of src/physics/p2/World.js">src/physics/p2/World.js line 166</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="restitution" data-name="restitution">
      <span class="type-signature"></span>restitution<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1931" title="restitution on line 1931 of src/physics/p2/World.js">src/physics/p2/World.js line 1931</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="sleepMode" data-name="sleepMode">
      <span class="type-signature"></span>sleepMode<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>How to deactivate bodies during simulation. Possible modes are: World.NO_SLEEPING, World.BODY_SLEEPING and World.ISLAND_SLEEPING.
If sleeping is enabled, you might need to wake up the bodies if they fall asleep when they shouldn't. If you want to enable sleeping in the world, but want to disable it for a particular body, see Body.allowSleep.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L2101" title="sleepMode on line 2101 of src/physics/p2/World.js">src/physics/p2/World.js line 2101</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="solveConstraints" data-name="solveConstraints">
      <span class="type-signature"></span>solveConstraints<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Enable/disable constraint solving in each step.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L2041" title="solveConstraints on line 2041 of src/physics/p2/World.js">src/physics/p2/World.js line 2041</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="time" data-name="time">
      <span class="type-signature">&lt;readonly> </span>time<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The World time.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L2063" title="time on line 2063 of src/physics/p2/World.js">src/physics/p2/World.js line 2063</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="total" data-name="total">
      <span class="type-signature">&lt;readonly> </span>total<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The total number of bodies in the world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L2125" title="total on line 2125 of src/physics/p2/World.js">src/physics/p2/World.js line 2125</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="useElapsedTime" data-name="useElapsedTime">
      <span class="type-signature"></span>useElapsedTime<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If true the frameRate value will be ignored and instead p2 will step with the value of Game.Time.delta, which is a delta time value.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L67" title="useElapsedTime on line 67 of src/physics/p2/World.js">src/physics/p2/World.js line 67</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="walls" data-name="walls">
      <span class="type-signature"></span>walls<span class="type-signature"> : object</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>An object containing the 4 wall bodies that bound the physics world.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">object</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L89" title="walls on line 89 of src/physics/p2/World.js">src/physics/p2/World.js line 89</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="world" data-name="world">
      <span class="type-signature">&lt;protected> </span>world<span class="type-signature"> : p2.World</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The p2 World in which the simulation is run.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">p2.World</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L55" title="world on line 55 of src/physics/p2/World.js">src/physics/p2/World.js line 55</a>
    

	

	

	
</dl>


    
</dd>

        </dl>
    

    
        <h3 class="subsection-title">Methods</h3>

        <dl>
            
<dt>
    <h4 class="name" id="addBody" data-name="addBody">
      <span class="type-signature"></span>addBody(body)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Add a body to the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>body</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Body to add to the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L906" title="addBody on line 906 of src/physics/p2/World.js">src/physics/p2/World.js line 906</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>True if the Body was added successfully, otherwise false.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="addConstraint" data-name="addConstraint">
      <span class="type-signature"></span>addConstraint(constraint)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Adds a Constraint to the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>constraint</code></td>
            

            <td class="type">
            
                
<span class="param-type">Phaser.Physics.P2.Constraint</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Constraint to add to the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1147" title="addConstraint on line 1147 of src/physics/p2/World.js">src/physics/p2/World.js line 1147</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Constraint that was added.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Phaser.Physics.P2.Constraint</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="addContactMaterial" data-name="addContactMaterial">
      <span class="type-signature"></span>addContactMaterial(material)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Adds a Contact Material to the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>material</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Contact Material to be added to the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1183" title="addContactMaterial on line 1183 of src/physics/p2/World.js">src/physics/p2/World.js line 1183</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Contact Material that was added.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="addSpring" data-name="addSpring">
      <span class="type-signature"></span>addSpring(spring)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Adds a Spring to the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>spring</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></span>
|

<span class="param-type">p2.LinearSpring</span>
|

<span class="param-type">p2.RotationalSpring</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Spring to add to the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L952" title="addSpring on line 952 of src/physics/p2/World.js">src/physics/p2/World.js line 952</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Spring that was added.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="beginContactHandler" data-name="beginContactHandler">
      <span class="type-signature"></span>beginContactHandler(event)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Handles a p2 begin contact event.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The event data.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L510" title="beginContactHandler on line 510 of src/physics/p2/World.js">src/physics/p2/World.js line 510</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="clear" data-name="clear">
      <span class="type-signature"></span>clear()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Clears all bodies from the simulation, resets callbacks and resets the collision bitmask.</p>
<p>The P2 world is also cleared:</p>
<ul>
<li>Removes all solver equations</li>
<li>Removes all constraints</li>
<li>Removes all bodies</li>
<li>Removes all springs</li>
<li>Removes all contact materials</li>
</ul>
<p>This is called automatically when you switch state.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L817" title="clear on line 817 of src/physics/p2/World.js">src/physics/p2/World.js line 817</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="clearTilemapLayerBodies" data-name="clearTilemapLayerBodies">
      <span class="type-signature"></span>clearTilemapLayerBodies(map [, layer])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Clears all physics bodies from the given TilemapLayer that were created with <code>World.convertTilemap</code>.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Tilemap.html">Phaser.Tilemap</a></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The Tilemap to get the map data from.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layer</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type">string</span>
|

<span class="param-type"><a href="Phaser.TilemapLayer.html">Phaser.TilemapLayer</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The layer to operate on. If not given will default to map.currentLayer.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1730" title="clearTilemapLayerBodies on line 1730 of src/physics/p2/World.js">src/physics/p2/World.js line 1730</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="convertCollisionObjects" data-name="convertCollisionObjects">
      <span class="type-signature"></span>convertCollisionObjects(map [, layer] [, addToWorld])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Converts all of the polyline, polygon, and rectangle objects inside a Tiled ObjectGroup into physics bodies that are added to the world.
Note that the polylines and polygons must be created in such a way that they can withstand polygon decomposition.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Tilemap.html">Phaser.Tilemap</a></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The Tilemap to get the map data from.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layer</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type">string</span>
|

<span class="param-type"><a href="Phaser.TilemapLayer.html">Phaser.TilemapLayer</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The layer to operate on. If not given will default to map.currentLayer.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>addToWorld</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true it will automatically add each body to the world.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1673" title="convertCollisionObjects on line 1673 of src/physics/p2/World.js">src/physics/p2/World.js line 1673</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>An array of the Phaser.Physics.Body objects that have been created.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">array</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="convertTilemap" data-name="convertTilemap">
      <span class="type-signature"></span>convertTilemap(map [, layer] [, addToWorld] [, optimize])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Goes through all tiles in the given Tilemap and TilemapLayer and converts those set to collide into physics bodies.
Only call this <em>after</em> you have specified all of the tiles you wish to collide with calls like Tilemap.setCollisionBetween, etc.
Every time you call this method it will destroy any previously created bodies and remove them from the world.
Therefore understand it's a very expensive operation and not to be done in a core game update loop.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Tilemap.html">Phaser.Tilemap</a></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The Tilemap to get the map data from.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layer</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type">string</span>
|

<span class="param-type"><a href="Phaser.TilemapLayer.html">Phaser.TilemapLayer</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The layer to operate on. If not given will default to map.currentLayer.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>addToWorld</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true it will automatically add each body to the world, otherwise it's up to you to do so.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>optimize</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true adjacent colliding tiles will be combined into a single body to save processing. However it means you cannot perform specific Tile to Body collision responses.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1753" title="convertTilemap on line 1753 of src/physics/p2/World.js">src/physics/p2/World.js line 1753</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>An array of the Phaser.Physics.P2.Body objects that were created.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">array</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createBody" data-name="createBody">
      <span class="type-signature"></span>createBody(x, y, mass [, addToWorld], options, points)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a new Body and adds it to the World.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The x coordinate of Body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The y coordinate of Body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>mass</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The mass of the Body. A mass of 0 means a 'static' Body is created.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>addToWorld</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Automatically add this Body to the world? (usually false as it won't have any shapes on construction).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>An object containing the build options:</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>optimalDecomp</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>skipSimpleCheck</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Set to true if you already know that the path is not intersecting itself.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>removeCollinearPoints</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>
|

<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Set to a number (angle threshold value) to remove collinear points, or false to keep all points.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>points</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;number></span>
|

<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>An array of 2d vectors that form the convex or concave polygon.
Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...],
or the arguments passed can be flat x,y values e.g. <code>setPolygon(options, x,y, x,y, x,y, ...)</code> where <code>x</code> and <code>y</code> are numbers.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1588" title="createBody on line 1588 of src/physics/p2/World.js">src/physics/p2/World.js line 1588</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The body</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createCollisionGroup" data-name="createCollisionGroup">
      <span class="type-signature"></span>createCollisionGroup( [object])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a new Collision Group and optionally applies it to the given object.
Collision Groups are handled using bitmasks, therefore you have a fixed limit you can create before you need to re-use older groups.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>object</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span>
|

<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>An optional Sprite or Group to apply the Collision Group to. If a Group is given it will be applied to all top-level children.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1453" title="createCollisionGroup on line 1453 of src/physics/p2/World.js">src/physics/p2/World.js line 1453</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="createContactMaterial" data-name="createContactMaterial">
      <span class="type-signature"></span>createContactMaterial( [materialA] [, materialB] [, options])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a Contact Material from the two given Materials. You can then edit the properties of the Contact Material directly.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>materialA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The first Material to create the ContactMaterial from. If undefined it will create a new Material object first.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>materialB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The second Material to create the ContactMaterial from. If undefined it will create a new Material object first.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Material options object.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1281" title="createContactMaterial on line 1281 of src/physics/p2/World.js">src/physics/p2/World.js line 1281</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Contact Material that was created.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createDistanceConstraint" data-name="createDistanceConstraint">
      <span class="type-signature"></span>createDistanceConstraint(bodyA, bodyB, distance [, localAnchorA] [, localAnchorB] [, maxForce])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a constraint that tries to keep the distance between two bodies constant.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>distance</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The distance to keep between the bodies.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>localAnchorA</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The anchor point for bodyA, defined locally in bodyA frame. Defaults to [0,0].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>localAnchorB</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The anchor point for bodyB, defined locally in bodyB frame. Defaults to [0,0].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>maxForce</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The maximum force that should be applied to constrain the bodies.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1002" title="createDistanceConstraint on line 1002 of src/physics/p2/World.js">src/physics/p2/World.js line 1002</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The constraint</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.DistanceConstraint.html">Phaser.Physics.P2.DistanceConstraint</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createGearConstraint" data-name="createGearConstraint">
      <span class="type-signature"></span>createGearConstraint(bodyA, bodyB [, angle] [, ratio])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a constraint that tries to keep the relative angle between two bodies constant.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>angle</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The relative angle</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ratio</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    1
                
                </td>
            

            <td class="description param-description last"><p>The gear ratio.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1031" title="createGearConstraint on line 1031 of src/physics/p2/World.js">src/physics/p2/World.js line 1031</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The constraint</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.GearConstraint.html">Phaser.Physics.P2.GearConstraint</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createLockConstraint" data-name="createLockConstraint">
      <span class="type-signature"></span>createLockConstraint(bodyA, bodyB [, offset] [, angle] [, maxForce])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Locks the relative position between two bodies.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offset</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The offset of bodyB in bodyA's frame. The value is an array with 2 elements matching x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>angle</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The angle of bodyB in bodyA's frame.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>maxForce</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The maximum force that should be applied to constrain the bodies.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1088" title="createLockConstraint on line 1088 of src/physics/p2/World.js">src/physics/p2/World.js line 1088</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The constraint</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.LockConstraint.html">Phaser.Physics.P2.LockConstraint</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createMaterial" data-name="createMaterial">
      <span class="type-signature"></span>createMaterial( [name] [, body])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a Material. Materials are applied to Shapes owned by a Body and can be set with Body.setMaterial().
Materials are a way to control what happens when Shapes collide. Combine unique Materials together to create Contact Materials.
Contact Materials have properties such as friction and restitution that allow for fine-grained collision control between different Materials.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Optional name of the Material. Each Material has a unique ID but string names are handy for debugging.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>body</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Optional Body. If given it will assign the newly created Material to the Body shapes.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1253" title="createMaterial on line 1253 of src/physics/p2/World.js">src/physics/p2/World.js line 1253</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Material that was created. This is also stored in Phaser.Physics.P2.materials.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createParticle" data-name="createParticle">
      <span class="type-signature"></span>createParticle(x, y, mass [, addToWorld], options, points)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a new Particle and adds it to the World.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The x coordinate of Body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The y coordinate of Body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>mass</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The mass of the Body. A mass of 0 means a 'static' Body is created.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>addToWorld</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Automatically add this Body to the world? (usually false as it won't have any shapes on construction).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>An object containing the build options:</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>optimalDecomp</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>skipSimpleCheck</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Set to true if you already know that the path is not intersecting itself.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>removeCollinearPoints</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>
|

<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Set to a number (angle threshold value) to remove collinear points, or false to keep all points.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>points</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;number></span>
|

<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>An array of 2d vectors that form the convex or concave polygon.
Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...],
or the arguments passed can be flat x,y values e.g. <code>setPolygon(options, x,y, x,y, x,y, ...)</code> where <code>x</code> and <code>y</code> are numbers.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1631" title="createParticle on line 1631 of src/physics/p2/World.js">src/physics/p2/World.js line 1631</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="createPrismaticConstraint" data-name="createPrismaticConstraint">
      <span class="type-signature"></span>createPrismaticConstraint(bodyA, bodyB [, lockRotation] [, anchorA] [, anchorB] [, axis] [, maxForce])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Constraint that only allows bodies to move along a line, relative to each other.
See http://www.iforce2d.net/b2dtut/joints-prismatic</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lockRotation</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If set to false, bodyB will be free to rotate around its anchor point.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>anchorA</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Body A's anchor point, defined in its own local frame. The value is an array with 2 elements matching x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>anchorB</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Body A's anchor point, defined in its own local frame. The value is an array with 2 elements matching x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>axis</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>An axis, defined in body A frame, that body B's anchor point may slide along. The value is an array with 2 elements matching x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>maxForce</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The maximum force that should be applied to constrain the bodies.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1116" title="createPrismaticConstraint on line 1116 of src/physics/p2/World.js">src/physics/p2/World.js line 1116</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The constraint</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.PrismaticConstraint.html">Phaser.Physics.P2.PrismaticConstraint</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createRevoluteConstraint" data-name="createRevoluteConstraint">
      <span class="type-signature"></span>createRevoluteConstraint(bodyA, pivotA, bodyB, pivotB [, maxForce] [, worldPivot])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Connects two bodies at given offset points, letting them rotate relative to each other around this point.
The pivot points are given in world (pixel) coordinates.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>pivotA</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The point relative to the center of mass of bodyA which bodyA is constrained to. The value is an array with 2 elements matching x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>pivotB</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The point relative to the center of mass of bodyB which bodyB is constrained to. The value is an array with 2 elements matching x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>maxForce</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The maximum force that should be applied to constrain the bodies.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>worldPivot</code></td>
            

            <td class="type">
            
                
<span class="param-type">Float32Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    null
                
                </td>
            

            <td class="description param-description last"><p>A pivot point given in world coordinates. If specified, localPivotA and localPivotB are automatically computed from this value.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1058" title="createRevoluteConstraint on line 1058 of src/physics/p2/World.js">src/physics/p2/World.js line 1058</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The constraint</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.RevoluteConstraint.html">Phaser.Physics.P2.RevoluteConstraint</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createRotationalSpring" data-name="createRotationalSpring">
      <span class="type-signature"></span>createRotationalSpring(bodyA, bodyB [, restAngle] [, stiffness] [, damping])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a rotational spring, connecting two bodies. A spring can have a resting length, a stiffness and damping.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>restAngle</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The relative angle of bodies at which the spring is at rest. If not given, it's set to the current relative angle between the bodies.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>stiffness</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    100
                
                </td>
            

            <td class="description param-description last"><p>Stiffness of the spring. A number &gt;= 0.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>damping</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    1
                
                </td>
            

            <td class="description param-description last"><p>Damping of the spring. A number &gt;= 0.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1560" title="createRotationalSpring on line 1560 of src/physics/p2/World.js">src/physics/p2/World.js line 1560</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The spring</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.RotationalSpring.html">Phaser.Physics.P2.RotationalSpring</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createSpring" data-name="createSpring">
      <span class="type-signature"></span>createSpring(bodyA, bodyB [, restLength] [, stiffness] [, damping] [, worldA] [, worldB] [, localA] [, localB])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a linear spring, connecting two bodies. A spring can have a resting length, a stiffness and damping.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bodyA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>First connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodyB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>
|

<span class="param-type">p2.Body</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Second connected body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>restLength</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    1
                
                </td>
            

            <td class="description param-description last"><p>Rest length of the spring. A number &gt; 0.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>stiffness</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    100
                
                </td>
            

            <td class="description param-description last"><p>Stiffness of the spring. A number &gt;= 0.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>damping</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    1
                
                </td>
            

            <td class="description param-description last"><p>Damping of the spring. A number &gt;= 0.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>worldA</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Where to hook the spring to body A in world coordinates. This value is an array by 2 elements, x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>worldB</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Where to hook the spring to body B in world coordinates. This value is an array by 2 elements, x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>localA</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Where to hook the spring to body A in local body coordinates. This value is an array by 2 elements, x and y, i.e: [32, 32].</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>localB</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Where to hook the spring to body B in local body coordinates. This value is an array by 2 elements, x and y, i.e: [32, 32].</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1528" title="createSpring on line 1528 of src/physics/p2/World.js">src/physics/p2/World.js line 1528</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The spring</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="destroy" data-name="destroy">
      <span class="type-signature"></span>destroy()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Clears all bodies from the simulation and unlinks World from Game. Should only be called on game shutdown. Call <code>clear</code> on a State change.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L892" title="destroy on line 892 of src/physics/p2/World.js">src/physics/p2/World.js line 892</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="enable" data-name="enable">
      <span class="type-signature"></span>enable(object [, debug] [, children])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>This will create a P2 Physics body on the given game object or array of game objects.
A game object can only have 1 physics body active at any one time, and it can't be changed until the object is destroyed.
Note: When the game object is enabled for P2 physics it has its anchor x/y set to 0.5 so it becomes centered.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>object</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>
|

<span class="param-type">array</span>
|

<span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The game object to create the physics body on. Can also be an array or Group of objects, a body will be created on every child that has a <code>body</code> property.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>debug</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Create a debug object to go with this body?</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>children</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>Should a body be created on all children of this object? If true it will recurse down the display list as far as it can go.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L316" title="enable on line 316 of src/physics/p2/World.js">src/physics/p2/World.js line 316</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="enableBody" data-name="enableBody">
      <span class="type-signature"></span>enableBody(object, debug)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Creates a P2 Physics body on the given game object.
A game object can only have 1 physics body active at any one time, and it can't be changed until the body is nulled.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>object</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The game object to create the physics body on. A body will only be created if this object has a null <code>body</code> property.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>debug</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description param-description last"><p>Create a debug object to go with this body?</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L374" title="enableBody on line 374 of src/physics/p2/World.js">src/physics/p2/World.js line 374</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="endContactHandler" data-name="endContactHandler">
      <span class="type-signature"></span>endContactHandler(event)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Handles a p2 end contact event.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The event data.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L536" title="endContactHandler on line 536 of src/physics/p2/World.js">src/physics/p2/World.js line 536</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="getBodies" data-name="getBodies">
      <span class="type-signature"></span>getBodies()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Populates and returns an array with references to of all current Bodies in the world.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1302" title="getBodies on line 1302 of src/physics/p2/World.js">src/physics/p2/World.js line 1302</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>An array containing all current Bodies in the world.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">array.&lt;<a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a>></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="getBody" data-name="getBody">
      <span class="type-signature"></span>getBody(object)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Checks the given object to see if it has a p2.Body and if so returns it.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>object</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The object to check for a p2.Body on.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1323" title="getBody on line 1323 of src/physics/p2/World.js">src/physics/p2/World.js line 1323</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The p2.Body, or null if not found.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">p2.Body</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="getConstraints" data-name="getConstraints">
      <span class="type-signature"></span>getConstraints()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Populates and returns an array of all current Constraints in the world.
You will get an array of p2 constraints back. This can be of mixed types, for example the array may contain
PrismaticConstraints, RevoluteConstraints or any other valid p2 constraint type.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1374" title="getConstraints on line 1374 of src/physics/p2/World.js">src/physics/p2/World.js line 1374</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>An array containing all current Constraints in the world.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">array.&lt;Phaser.Physics.P2.Constraint></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="getContactMaterial" data-name="getContactMaterial">
      <span class="type-signature"></span>getContactMaterial(materialA, materialB)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Gets a Contact Material based on the two given Materials.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>materialA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The first Material to search for.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>materialB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The second Material to search for.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1219" title="getContactMaterial on line 1219 of src/physics/p2/World.js">src/physics/p2/World.js line 1219</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Contact Material or false if none was found matching the Materials given.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></span>
|

<span class="param-type">boolean</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="getSprings" data-name="getSprings">
      <span class="type-signature"></span>getSprings()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Populates and returns an array of all current Springs in the world.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1353" title="getSprings on line 1353 of src/physics/p2/World.js">src/physics/p2/World.js line 1353</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>An array containing all current Springs in the world.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">array.&lt;<a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a>></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="hitTest" data-name="hitTest">
      <span class="type-signature"></span>hitTest(worldPoint [, bodies] [, precision] [, filterStatic])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Test if a world point overlaps bodies. You will get an array of actual P2 bodies back. You can find out which Sprite a Body belongs to
(if any) by checking the Body.parent.sprite property. Body.parent is a Phaser.Physics.P2.Body property.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>worldPoint</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Point to use for intersection tests. The points values must be in world (pixel) coordinates.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodies</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;(<a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a>|<a href="Phaser.Sprite.html">Phaser.Sprite</a>|p2.Body)></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>A list of objects to check for intersection. If not given it will check Phaser.Physics.P2.world.bodies (i.e. all world bodies)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>precision</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    5
                
                </td>
            

            <td class="description param-description last"><p>Used for matching against particles and lines. Adds some margin to these infinitesimal objects.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>filterStatic</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>If true all Static objects will be removed from the results array.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1397" title="hitTest on line 1397 of src/physics/p2/World.js">src/physics/p2/World.js line 1397</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>Array of bodies that overlap the point.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="mpx" data-name="mpx">
      <span class="type-signature"></span>mpx(v)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Convert p2 physics value (meters) to pixel scale.
By default Phaser uses a scale of 20px per meter.
If you need to modify this you can over-ride these functions via the Physics Configuration object.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>v</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The value to convert.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1843" title="mpx on line 1843 of src/physics/p2/World.js">src/physics/p2/World.js line 1843</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The scaled value.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="mpxi" data-name="mpxi">
      <span class="type-signature"></span>mpxi(v)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Convert p2 physics value (meters) to pixel scale and inverses it.
By default Phaser uses a scale of 20px per meter.
If you need to modify this you can over-ride these functions via the Physics Configuration object.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>v</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The value to convert.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1875" title="mpxi on line 1875 of src/physics/p2/World.js">src/physics/p2/World.js line 1875</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The scaled value.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="pause" data-name="pause">
      <span class="type-signature"></span>pause()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Pauses the P2 World independent of the game pause state.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L746" title="pause on line 746 of src/physics/p2/World.js">src/physics/p2/World.js line 746</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="preUpdate" data-name="preUpdate">
      <span class="type-signature"></span>preUpdate()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Called at the start of the core update loop. Purges flagged bodies from the world.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L297" title="preUpdate on line 297 of src/physics/p2/World.js">src/physics/p2/World.js line 297</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="pxm" data-name="pxm">
      <span class="type-signature"></span>pxm(v)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Convert pixel value to p2 physics scale (meters).
By default Phaser uses a scale of 20px per meter.
If you need to modify this you can over-ride these functions via the Physics Configuration object.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>v</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The value to convert.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1859" title="pxm on line 1859 of src/physics/p2/World.js">src/physics/p2/World.js line 1859</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The scaled value.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="pxmi" data-name="pxmi">
      <span class="type-signature"></span>pxmi(v)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Convert pixel value to p2 physics scale (meters) and inverses it.
By default Phaser uses a scale of 20px per meter.
If you need to modify this you can over-ride these functions via the Physics Configuration object.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>v</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The value to convert.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1891" title="pxmi on line 1891 of src/physics/p2/World.js">src/physics/p2/World.js line 1891</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The scaled value.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="removeBody" data-name="removeBody">
      <span class="type-signature"></span>removeBody(body)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Removes a body from the world. This will silently fail if the body wasn't part of the world to begin with.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>body</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Body to remove from the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L931" title="removeBody on line 931 of src/physics/p2/World.js">src/physics/p2/World.js line 931</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Body that was removed.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="removeBodyNextStep" data-name="removeBodyNextStep">
      <span class="type-signature"></span>removeBodyNextStep(body)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>This will add a P2 Physics body into the removal list for the next step.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>body</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The body to remove at the start of the next step.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L284" title="removeBodyNextStep on line 284 of src/physics/p2/World.js">src/physics/p2/World.js line 284</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="removeConstraint" data-name="removeConstraint">
      <span class="type-signature"></span>removeConstraint(constraint)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Removes a Constraint from the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>constraint</code></td>
            

            <td class="type">
            
                
<span class="param-type">Phaser.Physics.P2.Constraint</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Constraint to be removed from the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1165" title="removeConstraint on line 1165 of src/physics/p2/World.js">src/physics/p2/World.js line 1165</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Constraint that was removed.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Phaser.Physics.P2.Constraint</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="removeContactMaterial" data-name="removeContactMaterial">
      <span class="type-signature"></span>removeContactMaterial(material)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Removes a Contact Material from the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>material</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Contact Material to be removed from the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1201" title="removeContactMaterial on line 1201 of src/physics/p2/World.js">src/physics/p2/World.js line 1201</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Contact Material that was removed.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="removeSpring" data-name="removeSpring">
      <span class="type-signature"></span>removeSpring(spring)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Removes a Spring from the world.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>spring</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Spring to remove from the World.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L977" title="removeSpring on line 977 of src/physics/p2/World.js">src/physics/p2/World.js line 977</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Spring that was removed.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="reset" data-name="reset">
      <span class="type-signature"></span>reset()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Called by Phaser.Physics when a State swap occurs.
Starts the begin and end Contact listeners again.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L795" title="reset on line 795 of src/physics/p2/World.js">src/physics/p2/World.js line 795</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="resume" data-name="resume">
      <span class="type-signature"></span>resume()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Resumes a paused P2 World.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L758" title="resume on line 758 of src/physics/p2/World.js">src/physics/p2/World.js line 758</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="setBounds" data-name="setBounds">
      <span class="type-signature"></span>setBounds(x, y, width, height [, left] [, right] [, top] [, bottom] [, setCollisionGroup])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets the bounds of the Physics world to match the given world pixel dimensions.
You can optionally set which 'walls' to create: left, right, top or bottom.
If none of the walls are given it will default to use the walls settings it had previously.
I.e. if you previously told it to not have the left or right walls, and you then adjust the world size
the newly created bounds will also not have the left and right walls.
Explicitly state them in the parameters to override this.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The x coordinate of the top-left corner of the bounds.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The y coordinate of the top-left corner of the bounds.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>width</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The width of the bounds.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>height</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The height of the bounds.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>left</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true will create the left bounds wall.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>right</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true will create the right bounds wall.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>top</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true will create the top bounds wall.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bottom</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true will create the bottom bounds wall.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>setCollisionGroup</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true the Bounds will be set to use its own Collision Group.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L659" title="setBounds on line 659 of src/physics/p2/World.js">src/physics/p2/World.js line 659</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="setImpactEvents" data-name="setImpactEvents">
      <span class="type-signature"></span>setImpactEvents(state)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Impact event handling is disabled by default. Enable it before any impact events will be dispatched.
In a busy world hundreds of impact events can be generated every step, so only enable this if you cannot do what you need via beginContact or collision masks.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>state</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description param-description last"><p>Set to true to enable impact events, or false to disable.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L397" title="setImpactEvents on line 397 of src/physics/p2/World.js">src/physics/p2/World.js line 397</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="setMaterial" data-name="setMaterial">
      <span class="type-signature"></span>setMaterial(material, bodies)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets the given Material against all Shapes owned by all the Bodies in the given array.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>material</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Material to be applied to the given Bodies.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>bodies</code></td>
            

            <td class="type">
            
                
<span class="param-type">array.&lt;<a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a>></span>



            
            </td>

            

            

            <td class="description param-description last"><p>An Array of Body objects that the given Material will be set on.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1234" title="setMaterial on line 1234 of src/physics/p2/World.js">src/physics/p2/World.js line 1234</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="setPostBroadphaseCallback" data-name="setPostBroadphaseCallback">
      <span class="type-signature"></span>setPostBroadphaseCallback(callback, context)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets a callback to be fired after the Broadphase has collected collision pairs in the world.
Just because a pair exists it doesn't mean they <em>will</em> collide, just that they potentially could do.
If your calback returns <code>false</code> the pair will be removed from the narrowphase. This will stop them testing for collision this step.
Returning <code>true</code> from the callback will ensure they are checked in the narrowphase.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The callback that will receive the postBroadphase event data. It must return a boolean. Set to null to disable an existing callback.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>context</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            

            

            <td class="description param-description last"><p>The context under which the callback will be fired.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L418" title="setPostBroadphaseCallback on line 418 of src/physics/p2/World.js">src/physics/p2/World.js line 418</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="toJSON" data-name="toJSON">
      <span class="type-signature"></span>toJSON()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Converts the current world into a JSON object.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L1440" title="toJSON on line 1440 of src/physics/p2/World.js">src/physics/p2/World.js line 1440</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>A JSON representation of the world.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">object</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="update" data-name="update">
      <span class="type-signature"></span>update()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Internal P2 update loop.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L770" title="update on line 770 of src/physics/p2/World.js">src/physics/p2/World.js line 770</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="updateBoundsCollisionGroup" data-name="updateBoundsCollisionGroup">
      <span class="type-signature"></span>updateBoundsCollisionGroup( [setCollisionGroup])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>By default the World will be set to collide everything with everything. The bounds of the world is a Body with 4 shapes, one for each face.
If you start to use your own collision groups then your objects will no longer collide with the bounds.
To fix this you need to adjust the bounds to use its own collision group first BEFORE changing your Sprites collision group.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>setCollisionGroup</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>If true the Bounds will be set to use its own Collision Group.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.20.1/src/physics/p2/World.js#L620" title="updateBoundsCollisionGroup on line 620 of src/physics/p2/World.js">src/physics/p2/World.js line 620</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        </dl>
    

    

    
</article>

</section>



</div>
	    <footer class="footer">


<p class="package-signature">
  phaser-ce@2.20.1
  is on
  <a href="https://github.com/photonstorm/phaser-ce/releases/tag/v2.20.1">GitHub</a>
  and
  <a href="https://www.npmjs.com/package/phaser-ce">NPM</a>
</p>





	<p class="copyright">
	Phaser Copyright © 2012-2016 Photon Storm Ltd.
	</p>


<p class="jsdoc-message">
	Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a>
	
		on 2024-10-05
	
	using <a href="https://github.com/photonstorm/phaser-ce/tree/master/resources/docstrap-master">Tomorrow</a>.
</p>

</footer>

		</div>
    
      <div class="toc-container hidden-xs hidden-sm">
  <div class="toc-filter">
    <div class="form-inline">
    <div class="form-group">
      <label for="filter" class="control-label">Filter</label>
      <input type="text" class="form-control" id="toc-filter-input">
    </div>
  </div>
  </div>
  <div id="toc">
    <div class="list-group">
      <div id="toc-insert"></div>
    </div>
  </div>
</div>

    
	</div>
</div>

<script defer src="scripts/bundle.js?2024100511"></script>



</body>
</html>